const os = require('os')
const ip = os.networkInterfaces()['en0'].filter((obj) => obj['family'] == 'IPv4')[0]['address']
const titleSrc = `http://${ip}:8080/title.jpeg`
const chapterList = new Array(14).fill(null).map((_, index) => {
    return {
        chapterNum: `Chapter${index}`,
        src: 'https://p6-passport.byteacctimg.com/img/user-avatar/0d7fb3557987c0650bfc0fbf71cee214~100x100.awebp',
        chapterName: '广袤的世界'
    }
})
const characterList = [
    {
        characterName: 'aeris',
        src: titleSrc
    },
    {
        characterName: 'aeris',
        src: titleSrc
    },
    {
        characterName: 'aeris',
        src: titleSrc
    },
    {
        characterName: 'aeris',
        src: titleSrc
    }
]
const topSongList = [
    { id: 0, src: titleSrc, title: '片翼天使', artist: '植松伸夫', audioSrc: `http://${ip}:8080/8.mp3` },
    { id: 1, src: titleSrc, title: '片翼天使', artist: '植松伸夫', audioSrc: `http://${ip}:8080/49.mp3` },
    { id: 2, src: titleSrc, title: '片翼天使', artist: '植松伸夫', audioSrc: `http://${ip}:8080/157.mp4` },
    { id: 3, src: titleSrc, title: '片翼天使', artist: '植松伸夫', audioSrc: `http://${ip}:8080/27.mp3` },
    { id: 4, src: titleSrc, title: '片翼天使', artist: '植松伸夫', audioSrc: `http://${ip}:8080/28.mp3` },
    { id: 5, src: titleSrc, title: '片翼天使', artist: '植松伸夫', audioSrc: `http://${ip}:8080/161.mp3` },
    { id: 6, src: titleSrc, title: '片翼天使', artist: '植松伸夫', audioSrc: `http://${ip}:8080/2.mp3` },
    { id: 7, src: titleSrc, title: 'aeris theme', artist: '植松伸夫', audioSrc: `http://${ip}:8080/3.mp3` },
    { id: 8, src: titleSrc, title: 'aeris theme', artist: '植松伸夫', audioSrc: `http://${ip}:8080/1.mp3` },
    { id: 9, src: titleSrc, title: 'aeris theme', artist: '植松伸夫', audioSrc: `http://${ip}:8080/54.mp3` },
    { id: 10, src: titleSrc, title: 'aeris theme', artist: '植松伸夫', audioSrc: `http://${ip}:8080/55.mp3` },
]
module.exports = {
    // 'GET /api/getChapterList': {
    //     code: 0,
    //     data: {
    //         list: pageList
    //     }
    // },
    'GET /api/getChapterList 400': {
        code: 0,
        data: {
            chapterList,
            characterList
        }
    },
    'POST /api/getTopSongList 400': (req, res) => {
        res.json({
            code: 0,
            data: {
                topSongList,
                playListId: Number(Date.now())
            }
        })
    }
}